package org.belkodevelop.geocoding.adress.domen;

import java.io.Serializable;

public class CompositeAdress implements Serializable {
    private String room;
            
    private Short floor;
    
    private String streetNumber;
    
    private String streetAddress;
            
    private String route;
            
    private String sublocality;
            
    private String locality;
    
    private String administrativeAreaLevel3;

    private String administrativeAreaLevel2;
    
    private String administrativeAreaLevel1;
            
    private String country;

    public String getRoom() {
        return room;
    }

    public void setRoom(String room) {
        this.room = room;
    }

    public Short getFloor() {
        return floor;
    }

    public void setFloor(Short floor) {
        this.floor = floor;
    }

    public String getStreetNumber() {
        return streetNumber;
    }

    public void setStreetNumber(String streetNumber) {
        this.streetNumber = streetNumber;
    }

    public String getStreetAddress() {
        return streetAddress;
    }

    public void setStreetAddress(String streetAddress) {
        this.streetAddress = streetAddress;
    }

    public String getRoute() {
        return route;
    }

    public void setRoute(String route) {
        this.route = route;
    }

    public String getSublocality() {
        return sublocality;
    }

    public void setSublocality(String sublocality) {
        this.sublocality = sublocality;
    }

    public String getLocality() {
        return locality;
    }

    public void setLocality(String locality) {
        this.locality = locality;
    }

    public String getAdministrativeAreaLevel3() {
        return administrativeAreaLevel3;
    }

    public void setAdministrativeAreaLevel3(String administrativeAreaLevel3) {
        this.administrativeAreaLevel3 = administrativeAreaLevel3;
    }

    public String getAdministrativeAreaLevel2() {
        return administrativeAreaLevel2;
    }

    public void setAdministrativeAreaLevel2(String administrativeAreaLevel2) {
        this.administrativeAreaLevel2 = administrativeAreaLevel2;
    }

    public String getAdministrativeAreaLevel1() {
        return administrativeAreaLevel1;
    }

    public void setAdministrativeAreaLevel1(String administrativeAreaLevel1) {
        this.administrativeAreaLevel1 = administrativeAreaLevel1;
    }

    public String getCountry() {
        return country;
    }

    public void setCountry(String country) {
        this.country = country;
    }

    @Override
    public int hashCode() {
        int h = 0;
        if (room != null) {
            h += room.hashCode();
        }
        if (floor != null) {
            h *= 7 + floor.hashCode();
        }
        if (streetNumber != null) {
            h *= 7 + streetNumber.hashCode();
        }
        if (streetAddress != null) {
            h *= 7 + streetAddress.hashCode();
        }
        if (route != null) {
            h *= 7 + route.hashCode();
        }
        if (sublocality != null) {
            h *= 7 + sublocality.hashCode();
        }
        if (locality != null) {
            h *= 7 + locality.hashCode();
        }
        if (administrativeAreaLevel3 != null) {
            h *= 7 + administrativeAreaLevel3.hashCode();
        }
        if (administrativeAreaLevel2 != null) {
            h *= 7 + administrativeAreaLevel2.hashCode();
        }
        if (administrativeAreaLevel1 != null) {
            h *= 7 + administrativeAreaLevel1.hashCode();
        }
        if (country != null) {
            h *= 7 + country.hashCode();
        }
        return h;
    }
 
    @Override
    public boolean equals(Object obj) {
        if (obj == null){ 
            return false;
        }
        if (!(obj instanceof CompositeAdress)) { 
            return false;
        }
        if (this == obj) { 
            return true;
        }
        CompositeAdress at = (CompositeAdress) obj;
        return (room == null ? at.room == null : room.equals(at.room)) &&
                (floor == null ? at.floor == null : floor.equals(at.floor)) &&
                (streetNumber == null ? at.streetNumber == null : streetNumber.equals(at.streetNumber)) &&
                (streetAddress == null ? at.streetAddress == null : streetAddress.equals(at.streetAddress)) &&
                (route == null ? at.route == null : route.equals(at.route)) &&
                (sublocality == null ? at.sublocality == null : sublocality.equals(at.sublocality)) &&
                (locality == null ? at.locality == null : locality.equals(at.locality)) &&
                (administrativeAreaLevel3 == null ? at.administrativeAreaLevel3 == null : administrativeAreaLevel3.equals(at.administrativeAreaLevel3)) &&
                (administrativeAreaLevel2 == null ? at.administrativeAreaLevel2 == null : administrativeAreaLevel2.equals(at.administrativeAreaLevel2)) &&
                (administrativeAreaLevel1 == null ? at.administrativeAreaLevel1 == null : administrativeAreaLevel1.equals(at.administrativeAreaLevel1));
    }
}
